
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>hifive unmached · book for nxos</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="nxos development team">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="d1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://book-os.com" target="_blank" class="custom-link">bookos</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" >
            
                <span>
            
                    
                    NXOS文档中心
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" >
            
                <span>
            
                    
                    简介
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    NXOS 简介
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.2" >
            
                <span>
            
                    
                    快速上手
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.2.1" data-path="../../tutorial/quick-start.html">
            
                <a href="../../tutorial/quick-start.html">
            
                    
                    虚拟平台运行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2.2" data-path="../../tutorial/build-romdisk.html">
            
                <a href="../../tutorial/build-romdisk.html">
            
                    
                    构建romdisk
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3" >
            
                <span>
            
                    
                    内核
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.1" data-path="../base/framework.html">
            
                <a href="../base/framework.html">
            
                    
                    整体框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.2" data-path="../base/start.html">
            
                <a href="../base/start.html">
            
                    
                    启动流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3" data-path="../mm/mm.html">
            
                <a href="../mm/mm.html">
            
                    
                    内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.3.1" data-path="../mm/buddy.html">
            
                <a href="../mm/buddy.html">
            
                    
                    buddy伙伴算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3.2" data-path="../mm/heap.html">
            
                <a href="../mm/heap.html">
            
                    
                    heapCache虚拟内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.3.3" data-path="../mm/vmspace.html">
            
                <a href="../mm/vmspace.html">
            
                    
                    vmspace虚拟地址空间
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.4" data-path="../sched/sched.html">
            
                <a href="../sched/sched.html">
            
                    
                    调度管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.4.1" data-path="../sched/thread.html">
            
                <a href="../sched/thread.html">
            
                    
                    线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3.4.2" data-path="../sched/smp.html">
            
                <a href="../sched/smp.html">
            
                    
                    SMP多核调度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.5" data-path="../process/process.html">
            
                <a href="../process/process.html">
            
                    
                    进程管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.5.1" data-path="../process/syscall.html">
            
                <a href="../process/syscall.html">
            
                    
                    系统调用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.6" data-path="../interrupt/irq.html">
            
                <a href="../interrupt/irq.html">
            
                    
                    中断系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.3.6.1" data-path="../interrupt/delay_queue.html">
            
                <a href="../interrupt/delay_queue.html">
            
                    
                    延迟队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.3.7" data-path="../timer/timer.html">
            
                <a href="../timer/timer.html">
            
                    
                    定时器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.4" >
            
                <span>
            
                    
                    内核移植
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.4.1" data-path="../port/riscv/riscv.html">
            
                <a href="../port/riscv/riscv.html">
            
                    
                    riscv架构移植
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.5" >
            
                <span>
            
                    
                    平台支持
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.5.1" data-path="i386.html">
            
                <a href="i386.html">
            
                    
                    i386
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.2" data-path="qemu_riscv64.html">
            
                <a href="qemu_riscv64.html">
            
                    
                    qemu_riscv64
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.3" data-path="k210.html">
            
                <a href="k210.html">
            
                    
                    k210
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5.4" data-path="d1.html">
            
                <a href="d1.html">
            
                    
                    d1-nezha
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.5.5" data-path="hifive_unmached.html">
            
                <a href="hifive_unmached.html">
            
                    
                    hifive unmached
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.6" >
            
                <span>
            
                    
                    用户态服务和驱动框架
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.6.1" data-path="../user/userver.html">
            
                <a href="../user/userver.html">
            
                    
                    用户态服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6.2" data-path="../user/udriver.html">
            
                <a href="../user/udriver.html">
            
                    
                    用户态驱动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6.3" data-path="../user/ubpf.html">
            
                <a href="../user/ubpf.html">
            
                    
                    UBPF
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.7" >
            
                <span>
            
                    
                    用户接口
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.7.1" data-path="../user/api.html">
            
                <a href="../user/api.html">
            
                    
                    API设计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.1.8" >
            
                <span>
            
                    
                    编程开发
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.8.1" data-path="../../tutorial/code-style.html">
            
                <a href="../../tutorial/code-style.html">
            
                    
                    代码风格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.2" data-path="../../tutorial/commit-rule.html">
            
                <a href="../../tutorial/commit-rule.html">
            
                    
                    提交规则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.3" data-path="../../tutorial/menuconfig.html">
            
                <a href="../../tutorial/menuconfig.html">
            
                    
                    菜单配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.4" data-path="../../tutorial/toolchains.html">
            
                <a href="../../tutorial/toolchains.html">
            
                    
                    工具链
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8.5" data-path="../../tutorial/utest.html">
            
                <a href="../../tutorial/utest.html">
            
                    
                    单元测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >hifive unmached</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="hifive-unmached&#x5E73;&#x53F0;&#x7B80;&#x4ECB;">hifive unmached&#x5E73;&#x53F0;&#x7B80;&#x4ECB;</h1>
<p>SiFive &#x7684; HiFive Unmatched &#x662F;&#x57FA;&#x4E8E; Freedom U740 &#x5904;&#x7406;&#x5668;&#x7684;&#x6700;&#x65B0;&#x5E73;&#x53F0;&#xFF0C;
Freedom U740 &#x662F;&#x4E00;&#x6B3E;&#x9AD8;&#x6027;&#x80FD;&#x591A;&#x6838;&#x3001;64 &#x4F4D;&#x53CC;&#x53D1;&#x3001;&#x8D85;&#x6807;&#x91CF;&#x67B6;&#x6784;&#x7684; RISC-V &#x5904;&#x7406;&#x5668;&#x3002;</p>
<h2 id="&#x53C2;&#x6570;&#x89C4;&#x683C;">&#x53C2;&#x6570;&#x89C4;&#x683C;</h2>
<pre><code>&#x603B;&#x4ECB;
    SOC    
        4*U74 + 1*S7
    &#x5185;&#x5B58;
        16GB DDR4
    &#x5B58;&#x50A8;
        1.32 MB Quad SPI Boot Flash
        2.SD&#x5361;&#x69FD;
        3.M.2 M-Key Slot
    &#x7F51;&#x7EDC;
        Gigabit Ethernet Port
    &#x5176;&#x4ED6;
        4*USB-TypeA
        1*USB&#x4E32;&#x53E3;
        1*JTAG
        PCIE&#x5361;&#x69FD;
        M.2 E-Key Slot
</code></pre><p>&#x8F6F;&#x4EF6;&#x652F;&#x6301;&#xFF1A;</p>
<pre><code>Reset vector ROM
    &#x4F4D;&#x7F6E; : mask ROM &#x4E2D;&#x7684; 0x1000-0x1020 
    &#x4E0A;&#x7535;&#x540E; &#x6240;&#x6709;&#x6838;&#x5FC3;&#x7684; pc(&#x6BCF;&#x4E2A;&#x6838;&#x5FC3;&#x6709;&#x4E00;&#x4E2A;pc&#x5BC4;&#x5B58;&#x5668;) &#x4F4D;&#x4E8E; 0x1004
    &#x4F1A;&#x6839;&#x636E; MSEL[3:0] &#x9009;&#x62E9; jump &#x5230;
        1. loops forever waiting for debugger
        2. jump to memory-mapped QSPI0 // 0x2000_0000
        3. jump to memory-mapped QSPI1 // 0x3000_0000
        4. jump to ZSBL

bootrom/ZSBL:
    &#x4F4D;&#x7F6E; : mask ROM // memory-mapped 0x0000_1000-0x0000_1FFF

    &#x4F1A;&#x6839;&#x636E; MSEL[3:0] &#x9009;&#x62E9; load &#x7684;&#x6570;&#x636E; // &#x7528; QSPI  &#x63A5;&#x53E3; &#x4ECE; QSPIFlash &#x548C; sdcard
    1.&#x6839;&#x636E; MSEL[3:0] &#x5224;&#x5B9A;&#x5373;&#x5C06;load&#x7684;&#x6570;&#x636E;(u-boot spl)&#x5728;&#x54EA;&#x91CC;
    2.load&#x8BE5;&#x6570;&#x636E;&#x5230;&#x5185;&#x5B58;
    3.&#x8DF3;&#x8F6C;

    &#x6CE2;&#x7279;&#x7387; 89856 8n1
        &#x53EF;&#x4EE5;&#x7528; 57600 &#x6765;&#x89E3;&#x6790;
        &#x5982;&#x679C;&#x6709;&#x9519;&#x8BEF;,&#x5C31;&#x4F1A;&#x6253;&#x5370;&#x4FE1;&#x606F;, &#x5982;Error 0x00000000000000019
        &#x5982;&#x679C;&#x6CA1;&#x9519;&#x8BEF;,&#x4E0D;&#x4F1A;&#x6253;&#x5370;&#x4FE1;&#x606F;

    &#x7B2C;0&#x9636;&#x6BB5;&#x5F15;&#x5BFC;&#x52A0;&#x8F7D;&#x7A0B;&#x5E8F;&#xFF08;ZSBL&#xFF09;&#x5305;&#x542B;&#x5728;0x1_0000&#x7684;&#x63A9;&#x7801;ROM&#x4E2D;&#x3002;

    &#x5B83;&#x8D1F;&#x8D23;&#x4ECE;GUID&#x5206;&#x533A;&#x8868;&#x4E0B;&#x8F7D;&#x66F4;&#x590D;&#x6742;&#x7684;U-Boot SPL&#x3002;

    &#x6240;&#x6709;hart&#x90FD;&#x76F4;&#x63A5;&#x4ECE;&#x5916;&#x90E8;&#x65F6;&#x949F;&#x8F93;&#x5165;&#x8F93;&#x5165;&#x8F93;&#x5165;ZSBL&#xFF0C;&#x9884;&#x671F;&#x4E3A;26 MHz&#x3002;

    &#x5177;&#x6709;mhartid zero&#x7684;&#x5185;&#x6838;&#x914D;&#x7F6E;&#x5916;&#x56F4;&#x65F6;&#x949F;&#x5206;&#x914D;&#x5668;&#xFF0C;&#x7136;&#x540E;&#x641C;&#x7D22;GUID&#x7C7B;&#x578B;&#x4E3A;5B193300-FC78-40CD-8002-E86C45580B47&#x7684;&#x5206;&#x533A;&#x3002; // mhartid &#x4E3A; &#x975E;0 &#x7684;&#x6838;&#x5FC3;&#x5462; ? 

    &#x5B83;&#x9996;&#x5148;&#x4E0B;&#x8F7D;GPT&#x5934;&#xFF08;&#x5B57;&#x8282;512-604&#xFF09;&#xFF0C;&#x7136;&#x540E;&#x9010;&#x5757;&#xFF08;512&#x5B57;&#x8282;&#xFF09;&#x987A;&#x5E8F;&#x626B;&#x63CF;&#x5206;&#x533A;&#x8868;&#xFF0C;&#x76F4;&#x5230;&#x627E;&#x5230;&#x5206;&#x533A;&#x3002;

    &#x7136;&#x540E;&#xFF0C;&#x5C06;&#x8BE5;&#x5206;&#x533A;&#x7684;&#x5168;&#x90E8;&#x5185;&#x5BB9;U-Boot SPL&#x4E0B;&#x8F7D;&#x5230;&#x5730;&#x5740;0x0800_0000&#x5904;&#x7684;L2 LIM&#x4E2D;&#x3002;

    &#x7136;&#x540E;&#x6267;&#x884C;&#x5206;&#x652F;&#x5230;U-Boot SPL&#x3002;


u-boot spl : 
    &#x4F1A;&#x6839;&#x636E; MSEL[3:0] &#x5224;&#x65AD; opensbi &#x5728;&#x54EA;&#x91CC;
    1.&#x6839;&#x636E; MSEL[3:0] &#x5224;&#x5B9A;&#x5373;&#x5C06;load&#x7684;&#x6570;&#x636E;(opensbi)&#x5728;&#x54EA;&#x91CC;
    2.load&#x8BE5;&#x6570;&#x636E;&#x5230;&#x5185;&#x5B58;
    3.&#x8DF3;&#x8F6C;

    &#x6CE2;&#x7279;&#x7387; 115200 8n1

    U-Boot&#x8F85;&#x52A9;&#x7A0B;&#x5E8F;&#x52A0;&#x8F7D;&#x7A0B;&#x5E8F;&#xFF08;SPL&#xFF09;&#x4ECE;&#x4F4D;&#x4E8E;0x0800_0000&#x7684;L2 LIM&#x6267;&#x884C;&#x3002;

    &#x5B83;&#x8D1F;&#x8D23;&#x51C6;&#x5907;&#x4ECE;DDR&#x8FD0;&#x884C;&#x7684;&#x7CFB;&#x7EDF;&#x3002;

    &#x5B83;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x64CD;&#x4F5C;&#xFF1A;

    &#x2022;&#x914D;&#x7F6E;DDR PLL&#x3001;PHY&#x548C;&#x63A7;&#x5236;&#x5668;

    &#x2022;&#x5C06;GEM GXL TX PLL&#x8BBE;&#x7F6E;&#x4E3A;125 MHz&#x5E76;&#x91CD;&#x7F6E;

    &#x2022;&#x5982;&#x679C;&#x6709;&#x5916;&#x90E8;PHY&#xFF0C;&#x8BF7;&#x5C06;&#x5176;&#x91CD;&#x7F6E;

    &#x2022;&#x4ECE;GUID&#x7C7B;&#x578B;&#x4E3A;2E54B353-1271-4842-806F-E436D6AF69851&#x7684;&#x5206;&#x533A;&#x4E0B;&#x8F7D;OpenSBI&#x548C;U-boot&#x548C;u-boot&#x7684;&#x8BBE;&#x5907;&#x6811;dtb &#x5230; 0x8000_0000
        // U-Boot SPL&#x8BFB;&#x53D6;MSEL&#x5F00;&#x5173;&#x4EE5;&#x786E;&#x5B9A;&#x5728;&#x4F55;&#x5904;&#x67E5;&#x627E;&#x8BE5;&#x5206;&#x533A;


    &#x2022;&#x5728;OTP&#x4E0A;&#x626B;&#x63CF;&#x82AF;&#x7247;&#x5E8F;&#x5217;&#x53F7;

    &#x2022;&#x5C06;&#x5D4C;&#x5165;&#x5F0F;DTB&#x590D;&#x5236;&#x5230;DDR&#xFF0C;&#x586B;&#x5199;U-Boot SPL&#x7248;&#x672C;&#x3001;&#x5185;&#x5B58;&#x5927;&#x5C0F;&#x548C;MAC&#x5730;&#x5740;

    &#x2022;&#x542F;&#x7528;16&#x4E2A;L2&#x65B9;&#x5F0F;&#x4E2D;&#x7684;15&#x4E2A;&#xFF08;&#x8FD9;&#x5C06;&#x5220;&#x9664;&#x51E0;&#x4E4E;&#x6240;&#x6709;L2 LIM&#x5185;&#x5B58;&#xFF09;

    &#x2022;&#x8DF3;&#x8F6C;&#x5230;DDR&#x5185;&#x5B58;&#xFF08;0x8000_0000&#xFF09;



opensbi
    OpenSBI&#x4ECE;&#x4F4D;&#x4E8E;0x8000_0000&#x7684;DDR&#x6267;&#x884C;&#xFF0C;&#x5E76;&#x4FDD;&#x6301;&#x9A7B;&#x7559;&#x5728;&#x8BE5;&#x4F4D;&#x7F6E;&#x7684;&#x5185;&#x5B58;&#x4E2D;&#x3002;
    &#x5B83;&#x8D1F;&#x8D23;&#x63D0;&#x4F9B;&#x76D1;&#x63A7;&#x4E8C;&#x8FDB;&#x5236;&#x63A5;&#x53E3;&#xFF08;SBI&#xFF09;&#x4EE5;&#x53CA;&#x6A21;&#x62DF;&#x82AF;&#x7247;&#x672C;&#x8EAB;&#x672A;&#x5B9E;&#x73B0;&#x7684;&#x4EFB;&#x4F55;RISC-V&#x6240;&#x9700;&#x6307;&#x4EE4;&#x3002;
    // openSBI &#x5E94;&#x8BE5;&#x8DF3;&#x5230;&#x4E86; U-boot
    // U-boot &#x662F;&#x4EC0;&#x4E48;&#x65F6;&#x5019; &#x88AB;&#x52A0;&#x8F7D;&#x5230;&#x5185;&#x5B58;&#x7684;&#x5462;?
        // &#x731C;&#x60F3;&#x662F; U-boot SPL 
        // U-Boot SPL then loads and starts the next boot stage, consisting of OpenSBI and U-Boot, from the micro SD card into DRAM.
        // U-boot &#x5728;&#x54EA;&#x91CC; &#x4E0D;&#x662F; Sifive &#x89C4;&#x5B9A;&#x7684;

    &#x6CE2;&#x7279;&#x7387; &#x6CA1;&#x6709;&#x6253;&#x5370;,&#x5728; linux boot &#x9636;&#x6BB5; &#x6253;&#x5370;&#x51FA;&#x6765;

u-boot
    U-Boot&#x7BA1;&#x7406;&#x7528;&#x4E8E;&#x52A0;&#x8F7D;Linux&#x5185;&#x6838;&#x7684;&#x786C;&#x4EF6;&#x3002;&#x5728;&#x677F;&#x7EA7;&#xFF0C;U-Boot&#x5728;&#x63A7;&#x5236;&#x53F0;&#x4E32;&#x884C;&#x7AEF;&#x53E3;&#x4E0A;&#x516C;&#x5F00;&#x547D;&#x4EE4;&#x884C;&#x63A5;&#x53E3;&#x3002;
    &#x6709;&#x5173;U-Boot SiFive&#x4F7F;&#x7528;U-Boot&#x7684;&#x66F4;&#x591A;&#x4FE1;&#x606F;&#xFF0C;&#x8BF7;&#x53C2;&#x9605;HiFive Unmatched Software Reference Manual&#xFF08;HiFive Unmatched&#x8F6F;&#x4EF6;&#x53C2;&#x8003;&#x624B;&#x518C;&#xFF09;&#x3002;

    &#x6CE2;&#x7279;&#x7387; 115200 8n1
</code></pre><h1 id="&#x529F;&#x80FD;&#x652F;&#x6301;">&#x529F;&#x80FD;&#x652F;&#x6301;</h1>
<ul>
<li>[x] OpenSBI&#x56FA;&#x4EF6;</li>
<li>[x] &#x5185;&#x5B58;&#x7BA1;&#x7406;</li>
<li>[x] &#x4E0A;&#x4E0B;&#x6587;&#x5207;&#x6362;</li>
<li>[x] &#x5B9A;&#x65F6;&#x5668;&#x65F6;&#x949F;</li>
<li>[x] &#x539F;&#x5B50;&#x64CD;&#x4F5C;</li>
<li>[x] &#x5185;&#x5B58;&#x5C4F;&#x969C;</li>
<li>[x] SMP&#x591A;&#x6838;</li>
<li>[x] MMU&#x652F;&#x6301;</li>
<li>[x] &#x4E2D;&#x65AD;&#x7BA1;&#x7406;</li>
<li>[x] &#x7CFB;&#x7EDF;&#x8C03;&#x7528;&#x652F;&#x6301;</li>
<li>[x] &#x6267;&#x884C;&#x7528;&#x6237;&#x6001;&#x7A0B;&#x5E8F;</li>
<li>[x] &#x4E32;&#x53E3;&#x8F93;&#x5165;&#x8F93;&#x51FA;</li>
<li>[x] &#x901A;&#x8FC7;&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x548C;&#x96C6;&#x6210;&#x6D4B;&#x8BD5;</li>
<li>[ ] gdb&#x8C03;&#x8BD5;</li>
</ul>
<h1 id="&#x79FB;&#x690D;&#x6CE8;&#x610F;&#x4E8B;&#x9879;">&#x79FB;&#x690D;&#x6CE8;&#x610F;&#x4E8B;&#x9879;</h1>
<ol>
<li>FU740&#x6709;5&#x4E2A;&#x6838;&#xFF0C;&#x5C0F;&#x6838;&#x4E3A;0&#xFF0C;&#x5927;&#x6838;&#x5FC3;&#x4E3A;1-4&#xFF0C;&#x5C0F;&#x6838;core 0 &#x4E0D;&#x80FD;&#x901A;&#x8FC7;SBI&#x542F;&#x52A8; &#xFF08;&#x6240;&#x4EE5;&#x542F;&#x52A8;&#x8981;&#x4ECE;hartid=1&#x5F00;&#x59CB;&#xFF09;&#x3002;</li>
<li>MMU&#x7684;PTE&#x9700;&#x8981;&#x52A0;&#x5165;A&#x548C;D&#x4F4D;&#x624D;&#x884C;&#x3002;&#x542F;&#x7528;&#x9875;&#x8868;&#xFF08;&#x5199;satp&#xFF09;&#x4E4B;&#x540E;&#xFF0C;&#x7A0B;&#x5E8F;&#x5C31;&#x6CA1;&#x53CD;&#x5E94;&#x4E86;&#xFF0C;&#x8FD9;&#x662F;&#x56E0;&#x4E3A;FU740&#x5BF9;&#x9875;&#x8868;&#x9879;&#xFF08;PTE&#xFF09;&#x4E2D;&#x7684; A&#x3001;D&#x4F4D;&#x6709;&#x89C4;&#x5B9A;&#xFF0C;
&#x5B83;&#x4E0D;&#x652F;&#x6301;&#x786C;&#x4EF6;&#x4FEE;&#x6539;A&#x548C;D&#xFF0C;&#x5E76;&#x4E14;&#x4E00;&#x5B9A;&#x8981;&#x628A;A&#x548C;D&#x8BBE;&#x4E3A;1&#xFF0C;&#x5426;&#x5219;&#x4F1A;page fault&#xFF0C;&#x8FD9;&#x548C;&#x4E4B;&#x524D;&#x505A;&#x6CD5;&#x628A;A&#x3001;D&#x8BBE;&#x4E3A;0&#x7684;&#x662F;&#x4E0D;&#x4E00;&#x81F4;&#x7684;&#x3002;</li>
<li>&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x53EF;&#x80FD;&#x548C;&#x6807;&#x51C6;&#x7684;&#x542F;&#x52A8;&#x65B9;&#x5F0F;&#x6709;&#x5DEE;&#x5F02;&#xFF0C;&#x5BFC;&#x81F4;&#x7684;&#x95EE;&#x9898;&#x5C31;&#x662F;hartid&#x548C;&#x8BBE;&#x5907;&#x6811;&#x7684;&#x4F20;&#x9012;&#x95EE;&#x9898;&#xFF0C;&#x540E;&#x7EED;&#x53EF;&#x4EE5;&#x7814;&#x7A76;&#x6709;&#x6CA1;&#x6709;&#x66F4;&#x597D;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x5F15;&#x5BFC;&#xFF0C;&#x76EE;&#x524D;&#x662F;&#x7528;&#x4E0D;&#x4E0A;&#x8BBE;&#x5907;&#x6811;&#x7684;&#x3002;</li>
<li>PLIC&#x7684;&#x504F;&#x79FB;&#x5730;&#x5740;&#x4E5F;&#x6BD4;&#x8F83;&#x5947;&#x602A;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x6CE8;&#x610F;PLIC&#x7684;&#x5730;&#x5740;&#x548C;&#x67D0;&#x5757;&#x5185;&#x5B58;&#x533A;&#x57DF;&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x5728;MMU&#x6620;&#x5C04;&#x865A;&#x62DF;&#x5730;&#x5740;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x3002;</li>
<li>&#x5185;&#x6838;&#x7684;&#x94FE;&#x63A5;&#x5730;&#x5740;&#x662F;0x80200000&#xFF0C;U-Boot&#x4F1A;&#x8DF3;&#x8F6C;&#x8FDB;&#x5165;&#x5230;&#x6539;&#x5185;&#x5B58;&#x5730;&#x5740;&#x5E76;&#x6267;&#x884C;&#x3002;</li>
</ol>
<h1 id="&#x8FD0;&#x884C;&#x65B9;&#x6CD5;">&#x8FD0;&#x884C;&#x65B9;&#x6CD5;</h1>
<h2 id="&#x547D;&#x4EE4;&#x884C;">&#x547D;&#x4EE4;&#x884C;</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># 1. &#x8FDB;&#x5165;nxos&#x6E90;&#x7801;&#xFF0C;&#x6253;&#x5F00;&#x7EC8;&#x7AEF;&#x3002;</span>
<span class="hljs-comment"># 2. &#x521D;&#x59CB;&#x5316;&#x73AF;&#x5883;</span>
<span class="hljs-built_in">source</span> setup.sh hifive_unmached    <span class="hljs-comment"># linux</span>
setup.bat hifive_unmached          <span class="hljs-comment"># windows</span>
<span class="hljs-comment"># 3. &#x4E3A;&#x7B2C;&#x4E00;&#x6B21;&#x8FD0;&#x884C;&#x505A;&#x51C6;&#x5907;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x7B2C;&#x4E00;&#x6B21;&#x7684;&#x65F6;&#x5019;&#x8FD0;&#x884C;</span>
make prepare
<span class="hljs-comment"># 4. &#x83B7;&#x53D6;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;</span>
make defconfig
<span class="hljs-comment"># 5. &#x7F16;&#x8BD1;&#x8FD0;&#x884C;</span>
make run -j8 ACTION=poweron <span class="hljs-comment"># -jN&#x662F;&#x591A;&#x7EBF;&#x7A0B;&#x7F16;&#x8BD1;&#xFF0C;&#x7B2C;&#x4E00;&#x6B21;&#x8FD0;&#x884C;&#x9700;&#x8981;&#x4F7F;&#x7528;poweron&#x884C;&#x4E3A;</span>
make run -j8 <span class="hljs-comment"># &#x9ED8;&#x8BA4;&#x662F;ACTION=reboot&#x884C;&#x4E3A;</span>

<span class="hljs-comment"># 6. &#x4F7F;&#x7528;&#x5173;&#x95ED;&#x7535;&#x6E90;web&#x8BF7;&#x6C42;&#x5173;&#x95ED;&#x5F00;&#x53D1;&#x677F;</span>
make run -j8 ACTION=poweroff
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="d1.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: d1-nezha">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"hifive unmached","level":"1.1.5.5","depth":3,"next":{"title":"用户态服务和驱动框架","level":"1.1.6","depth":2,"ref":"","articles":[{"title":"用户态服务","level":"1.1.6.1","depth":3,"path":"programing-manual/user/userver.md","ref":"programing-manual/user/userver.md","articles":[]},{"title":"用户态驱动","level":"1.1.6.2","depth":3,"path":"programing-manual/user/udriver.md","ref":"programing-manual/user/udriver.md","articles":[]},{"title":"UBPF","level":"1.1.6.3","depth":3,"path":"programing-manual/user/ubpf.md","ref":"programing-manual/user/ubpf.md","articles":[]}]},"previous":{"title":"d1-nezha","level":"1.1.5.4","depth":3,"path":"programing-manual/platform/d1.md","ref":"programing-manual/platform/d1.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy BookOS-developers 2022","modify_label":"修订时间：","modify_format":"YYYY-MM-DD"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"nxos development team","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"book for nxos","language":"zh-hans","links":{"sidebar":{"bookos":"http://book-os.com"}},"gitbook":"3.2.3","description":"document for nxos kernel"},"file":{"path":"programing-manual/platform/hifive_unmached.md","mtime":"2022-05-26T19:44:09.812Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-06-21T14:02:23.265Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

